<template>
	<view>
		<view class="success">
			<u-icon name="checkbox-mark" size="240" color="rgba(255, 78, 38, 1)"
				:label="successtext+',即将在'+time+'秒后返回...'" label-pos="bottom" label-color="bleak" label-size="36rpx">
			</u-icon>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				successtext: "操作成功",
				time: 5,
				deltaing: 2
			}
		},
		methods: {
			goback() {
				setTimeout(()=>{
					uni.navigateBack({
						delta: 2
					})
				},5000);
			},
			timeback() {
				setInterval(() => {
					if (this.time > 0) {
						this.time--;
					}
				}, 1000);
			}
		},
		onLoad(option) {
			if (option.successtext) {
				this.successtext = option.successtext;
				// console.log(this.successtext);
			};
			if (option.delta) {
				this.deltaing = option.delta;
				// console.log(this.delta);
			};
			this.goback();
			this.timeback();
			
		}

	}
</script>

<style>
	.success {
		/* 		width: 200rpx;
		height: 200rpx; */
		/* border-radius: 50%; */
		/* background-color: rgba(0,0,0,0.2); */
		position: relative;
		top: 300rpx;
		text-align: center;
	}
</style>
